<template>
  <view class="container">
    <web-view :src="url" class="webview"></web-view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      url: '',
	  
    }
  },
  onLoad(options) {
    if (options.url) {
      // 解码URL
      this.url = decodeURIComponent(options.url)
	    
    } else {
      uni.showToast({
        title: '网址无效',
        icon: 'none'
      })
      setTimeout(() => {
        uni.navigateBack()
      }, 1500)
    }
  }
}
</script>

<style>
.container {
  flex: 1;
  height: 100vh;
}
.webview {
  width: 100%;
  height: 100%;
}
</style>